<HTML><HEAD><TITLE>os_file_name(?InternalName, ?ExternalName)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Operating System</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>os_file_name(?InternalName, ?ExternalName)</H1>
Conversion between internal ECLiPSe file name and Operating
System file name syntax.


<DL>
<DT><EM>InternalName</EM></DT>
<DD>String, atom or variable.
</DD>
<DT><EM>ExternalName</EM></DT>
<DD>String, atom or variable.
</DD>
</DL>
<H2>Description</H2>
   This predicate converts between internal (ECLiPSe) and external
   (operating system) file names. It works in both directions. 

<P>
   

<P>

<H3>Modes and Determinism</H3><UL>
<LI>os_file_name(+, -) is det
<LI>os_file_name(-, +) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Neither InternalName nor ExternalName are instantiated.
<DT><EM>(5) type error </EM>
<DD>InternalName or ExternalName are instantiated to something other than string or atom.
<DT><EM>(5) type error </EM>
<DD>InternalName or ExternalName are instantiated to different types.
</DL>
<H2>Examples</H2>
<PRE>
Success:
    On UNIX:
      [eclipse]: os_file_name("//a/b/c.def", OS).
      OS = "//a/b/c.def"
      yes

    On Windows:
      [eclipse]: os_file_name("//a/b/c.def", OS), write(OS).
      a:\b\c.def
      OS = "a:\\b\\c.def"
      yes

      [eclipse]: os_file_name(File, "a:\\b\\c.def").
      File = "//a/b/c.def"
      yes

Error:
      os_file_name(X, Y).                          (Error 4).
      os_file_name(4, X).                          (Error 5).
      os_file_name("/home/file", '/home/file').    (Error 5).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/opsys/existing_file-4.html">existing_file / 4</A>, <A HREF="../../kernel/opsys/pathname-4.html">pathname / 4</A>
</BODY></HTML>
